
# Lab3 Program

This program is a command-line interface (CLI) tool for calculating the integral of various functions using different numerical integration methods. The program supports multiple input modes for providing the required parameters, including reading from a file, command-line arguments, or interactive user input.

## Usage

The program can be executed with the following command-line options:

```
./lab3_cpp [--help | -h] [--file <filename> | -f <filename>] [--input | -i] [--args <function_type> <integral_method> <a> <b> <eps>]
```

### Options

- `--help` or `-h`: Display the help message and available commands.
- `--file <filename>` or `-f <filename>`: Read the parameters from the specified file.
- `--input` or `-i`: Interactively read the parameters from stdin.
- `--args <function_type> <integral_method> <a> <b> <eps>`: Provide the parameters directly as command-line arguments.

### Parameter Format

The program expects the following parameters:

- `function_type`: An integer representing the function type (0-5).
- `integral_method`: An integer representing the numerical integration method (0-4).
- `a`: The lower bound of the integration interval.
- `b`: The upper bound of the integration interval.
- `eps`: The desired accuracy (epsilon) for the integration result.

When using the `--file` option, the parameters should be provided in the file in the following format:

```
<function_type> <integral_method> <a> <b> <eps>
```

For example:
```
2 3 0.0 1.0 0.001
```
## Examples

1. Display the help message:
   ```
   ./lab3_cpp --help
   ```

2. Read parameters from a file named `params.txt`:
   ```
   ./lab3_cpp --file params.txt
   ```

3. Interactively provide parameters through stdin:
   ```
   ./lab3_cpp --input
   ```

4. Provide parameters directly as command-line arguments:
   ```
   ./lab3_cpp --args 2 3 0.0 1.0 0.001
   ```

Make sure to replace the parameter values with the desired function type, integration method, interval bounds, and accuracy according to your requirements.

## Output

The program will calculate the integral using the provided parameters and display the result to the console.
